Teaching C in a Functional Style

نویسنده

  • Andrew Davison
چکیده

The rst introduction to imperative programming for the majority of our students is with C, but fortunately it is preceded by a course on problem solving and program design using the lazy functional language Miranda. C is a diicult language to learn, but by drawing on the skills taught in the Miranda course, notions such as modularity, information hiding, recursion, abstraction, top-down design, functional composition, composite types, and higher order functions can be introduced relatively painlessly. One of the major tasks for programmers is the design and implementation of Abstract Data Types (ADTs). This is made more diicult in C by being based on dynamic data structures coded with pointers. We describe a translation strategy from a Miranda version of an ADT to a C version, which utilises all of the good programming habits developed with Miranda. The translation from Miranda to C allows a wide ranging discussion of many important topics: strict versus non-strict functions, recursive data structures, polymorphism, the importance of typing, pattern matching versus information hiding in ADTs, destructive versus non-destructive assignment, and the trade-oos between understandability and eeciency. This approach to C programming was used in a course at the end of 1993, and the results of a student questionnaire are brieey reported.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Matching Teaching/Learning Styles and Students’ Satisfaction

Part of the theoretical literature and researches conducted in the western countries especially in the USA, concerning learning styles and teaching styles, hypothesize that: a) students’ learning styles are different based on their gender, college degree, and major, b) teachers’ teaching style is consistent with their learning style, and c) matching teaching style/...

متن کامل

Understanding LOLITA: Experiences in Teaching Large Scale Functional Programming

LOLITA is a large scale natural processing system written in the functional language Haskell. It consists of over 47,000 lines of code written over 180 dierent modules. There are currently 20 people working on the system, most of whom are Ph.D. students. The majority of research projects involve the development of an application which is written around a semantic network; the knowledge represe...

متن کامل

The Relationship of Child Abuse and Functional Constipation in Children: A Case-Control Study

Background: Child abuse is a serious global problem and can be in the form of physical, sexual, emotional or neglect by not providing for the child's needs. Functional constipation (FC) is a common functional gastrointestinal (GI) disorder in children. This study was aimed to assess the relationship between child abuse and fu...

متن کامل

Relationship between Iranian EFL Teachers' Brain Dominance, Teaching Experience and their Teaching Style

The present study sought to explore the relationship between Iranian EFL teachers' brain dominance, teaching experience and their teaching style. The study population consisted of all EFL teachers of high schools in Shiraz holding a B.A degree, with the sample consisting of 100 participants recruited through convenience sampling. The study employed a descriptive correlational design. To collect...

متن کامل

Reflective Teaching and Its Impact on Students\' Achievement in English

Reflective Teaching and Its Impact on Students' Achievement in English F. Ghorbaan Dordinejaad, Ph.D. M. Rashvand Reflective teaching as a style in teaching has shown to be effective across different academic areas, in which teaching English is no exception. To demonstrate its effectiveness, a sample of 70 English teachers in Ghazvin was asked to answer two sets of questions o...

متن کامل

Cultural Components and Subcomponents in Two Persian and English Language Teaching Textbooks: A Comparative Study

The present qualitative research, for the first time, aimed at comparing and contrasting the extent cultural components and subcomponents are represented in the elementary levels of A Course in General Persian and Top Notch Series as foreign language teaching textbooks. The adapted checklist of Lee's Big ‘C' and little ‘c' cultural components (2009) was used for the current study.  After conten...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1994